import 'package:environmental_les_app/common/style/my_custom_indicator.dart';
import 'package:flutter/material.dart';

import '../style/colours.dart';

class Themes {
  static final main = ThemeData.light().copyWith(
    scaffoldBackgroundColor: Colours.bgColor,
    platform: TargetPlatform.iOS,
    primaryColor: Colours.appMain,
    focusColor: Colors.transparent,
    splashColor: Colors.transparent,
    // 水波纹颜色
    highlightColor: Colors.transparent,
    // 选中高亮的颜色
    indicatorColor: Colours.appMain,
    // TabBar指示器颜色
    colorScheme:
        ThemeData.light().colorScheme.copyWith(primary: Colours.appMain),
    iconTheme: const IconThemeData(color: Colours.appMain),
    tabBarTheme: TabBarTheme(
      indicator: MyCustomIndicator(),
      labelColor: Colours.text254,
      unselectedLabelColor: Colours.text09C,
      labelStyle: const TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold),
      unselectedLabelStyle:
          const TextStyle(fontSize: 14.0, fontWeight: FontWeight.normal),
    ),
    switchTheme: SwitchThemeData(
      thumbColor: MaterialStateProperty.all(Colours.appMain),
      trackColor: MaterialStateProperty.all(const Color(0xFFDDDDDD)),
    ),
    textButtonTheme: TextButtonThemeData(
      style: ButtonStyle(
        overlayColor: MaterialStateProperty.all(Colors.transparent),
        foregroundColor: MaterialStateProperty.all(Colours.appMain),
      ),
    ),
    appBarTheme: const AppBarTheme(
      titleTextStyle: TextStyle(
          color: Colours.text254, fontSize: 18.0, fontWeight: FontWeight.w500),
      backgroundColor: Colors.white,
      foregroundColor: Colours.text254,
      elevation: 1.0,
    ),
    elevatedButtonTheme: ElevatedButtonThemeData(
        style: ButtonStyle(
            backgroundColor: MaterialStateProperty.all(Colours.appMain))),
    bottomNavigationBarTheme: const BottomNavigationBarThemeData(
        backgroundColor: Colors.white,
        selectedItemColor: Colours.appMain,
        elevation: 5.0,
        unselectedItemColor: Colors.grey,
        selectedLabelStyle: TextStyle(fontSize: 12),
        unselectedLabelStyle: TextStyle(fontSize: 12),
        type: BottomNavigationBarType.fixed),
    // 页面转场动画
    pageTransitionsTheme: const PageTransitionsTheme(
      builders: {
        TargetPlatform.android: CupertinoPageTransitionsBuilder(),
        TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
      },
    ),
  );
}
